-
Notifications
You must be signed in to change notification settings - Fork 56
Performance and bug-fix backports #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This contains various backports: * Reduced allocations and performance improvements in state resolution * Reduced allocations and performance improvements in JSON handling * Event auth fixes, including correct error surfacing
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
==========================================
- Coverage 59.85% 59.68% -0.18%
==========================================
Files 51 51
Lines 7146 7158 +12
==========================================
- Hits 4277 4272 -5
- Misses 2477 2489 +12
- Partials 392 397 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1936291 to
3d48766
Compare
S7evinK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
authstate.go
Outdated
| authEvents, err := NewAuthEvents(nil) | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this always returns a nil error, may be worth to remove the err check? (Similar for other call sites where we pass in nil)
| ) | ||
|
|
||
| go 1.18 | ||
| go 1.22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
stateresolutionv2.go
Outdated
| addFromAuthEventsIfNotRejected := func(event PDU, eventType, stateKey string) { | ||
| for _, authEventID := range event.AuthEventIDs() { | ||
| if _, ok := r.isRejectedCache[authEventID]; !ok { | ||
| r.isRejectedCache[authEventID] = r.isRejectedFn(authEventID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid having to lookup the authEventID right after setting it
| r.isRejectedCache[authEventID] = r.isRejectedFn(authEventID) | |
| isRejected := r.isRejectedFn(authEventID) | |
| r.isRejectedCache[authEventID] = isRejected | |
| if isRejected { | |
| continue | |
| } |
e090245 to
0d17b17
Compare
This contains various backports from Harmony:
PerformBackfillcallsCloses #439 as superseded by changes in this PR.
Signed-off-by: Neil Alexander [email protected]